/*
Kakine
ActionScript Framework
Copyright © 2011, PUNY, LLC.

This file is part of KAKINE.

KAKINE is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

KAKINE is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with KAKINE.  If not, see <http://www.gnu.org/licenses/>.
*/ 
package com.puny.ball.views
{
	import com.puny.mvc.helpers.FrameHelper;
	import com.puny.mvc.views.View;
	
	public class ShotView extends View
	{
		protected var _power:Number;
		public function ShotView(src:Object)
		{
			super(src);
		}

		public function set power(value:Number):void {
			alpha = 1;
			_power = value;
		}
		
		public function release():void {
			FrameHelper.setup(this, null, releasing, released);
		}
		
		protected function releasing():Boolean {
			alpha -= .05;
			return alpha > .1;
		}
		
		protected function released():void {
			power = 0;
			alpha = 0;
		}
	}
}